#include "kernel/types.h"
#include "kernel/stat.h"
#include "user/user.h"

int
main(int argc, char *argv[])
{
  if(argc <= 1){
    printf("sleep: missing operand\n");
    exit(1);
  }
  char *p = argv[1];
  while(*p != '\0'){
    if(*p<'0' || *p>'9'){
      printf("sleep: argument must be a number\n");
      exit(1);
    }
    p++;
  }

  int sleepSec = atoi(argv[1]);
  // printf("sleep: sleep for %d seconds\n",sleepSec);
  sleep(sleepSec);

  exit(0);
}
